import java.util.ArrayList;

/**
 * @ClassName StuDemo03
 * @Description 静态代码块
 * @Author Li
 * @Date 2022/8/1 9:17
 * @ModifyDate 2022/8/1 9:17
 * @Version 1.0
 */
public class StuDemo03 {
    public static int number;
    public static ArrayList<String> list;

    static {
        // 给类变量赋值
        number = 2;
        list = new ArrayList<>();
        // 添加元素到集合中
        list.add("张三");
        list.add("李四");
    }

    public static void main(String[] args) {
        System.out.println(number);
        System.out.println(list);
    }
}
